package com.bgt.springboot.first.utils;

import java.util.HashMap;
import java.util.List;

/**
 * Created by baiguantao on 2017/6/19.
 * 分页工具类
 */
public class Page<T> {
    private  int totalRecords=0;
    private  int pageNo=1;//当前第几页
    private  int pageSize=10;//每页显示几条
    private  int pageNum=10;//页数
    private  T queryParams;//查询条件
    private HashMap<String,Object> params;//查询条件

    private List<T> results;
    public  Page(int pageNo){
       this.pageNo=pageNo;
    }
    public  Page(int pageNo,int pageSize){
       this.pageNo=pageNo;
       this.pageSize=pageSize;
    }
    public int getTotalRecords() {
        return totalRecords;
    }
    /*计算总页数？*/
    public void setTotalRecords(int totalRecords) {
        /**设置页数*/
        this.totalRecords = totalRecords;
    }

    public int getPageNo() {
        return pageNo;
    }

    public void setPageNo(int pageNo) {
        this.pageNo = pageNo;
    }

    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }

    public List<T> getResults() {
        return results;
    }

    public void setResults(List<T> results) {
        this.results = results;
    }

    public int getPageNum() {
        return pageNum;
    }

    public void setPageNum(int pageNum) {
        this.pageNum = pageNum;
    }

    public T getQueryParams() {
        return queryParams;
    }

    public void setQueryParams(T queryParams) {
        this.queryParams = queryParams;
    }

    public HashMap<String, Object> getParams() {
        return params;
    }

    public void setParams(HashMap<String, Object> params) {
        this.params = params;
    }
}
